# coding: utf-8


import httpx
import uvicorn
from fastapi import Depends, FastAPI

app = FastAPI()
url = "http://61.177.250.76:8088/api/v1/json/queryPhone"


@app.get("/api/phone/{department}")
def get_phone(department: str):
    data = {"department": department}
    response = httpx.get(url, params=data)
    return response.json()


@app.get("/")
def index():
    return {"message": "Hello, FastAPI!"}


if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=8000)
